local Protect_drawNcards = fk.CreateSkill {
  name = "#Protect_drawNcards",
  tags = { Skill.Compulsory },
}

local white_package_extensionName = {"shzl","standard_ex","yj","sp","ol","tenyear","mougong","mobile"}

Protect_drawNcards:addEffect(fk.BeforeDrawCard, {
  mute = true,
  global = true,
  priority = 0.1,
  can_trigger = function(self, event, target, player, data)
    return target == player and data.who == player and data.num > 20
  end,
  on_use = function(self, event, target, player, data)
    local skill = Fk.skills[data.skillName and data.skillName or self.name]
    if table.contains(white_package_extensionName, skill.package.extensionName) then
      player.room:doBroadcastNotify("ShowToast", "全知之眼 : " .. Fk:translate(player.general) .. "摸的牌实在是太多了，改为少摸5张")
      if data.num > 20 then
        data.num = data.num - 5
      end
    else
      player.room:doBroadcastNotify("ShowToast", "全知之眼：本服专属摸牌监测！" .. Fk:translate(player.general) .. "的牌实在是太多了，削弱摸牌数量")
      data.num = 20
    end
  end
})

return Protect_drawNcards